#include<Servo.h>
Servo myservo;
int pos = 0;

void setup() {
  // put your setup code here, to run once:
  myservo.attach(9);
}

void loop() {
  // put your main code here, to run repeatedly:
  //myservo.write(90);
  for(pos = 0;pos<180;pos+=1){
    myservo.write(pos);
    delay(1);
  }
  delay(1);
  for(pos = 180;pos>=0;pos-=1){
    myservo.write(pos);
    delay(1);
  }
  delay(1);
}
